package com.sh.data.engine.application.model.request.normalization;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

@Data
@Schema
public class TblRelationRequest {

    /**
     * 主表id
     */
    @NotNull
    @Min(value = 1)
    @Schema(description = "主表id")
    private Long mainTableId;

    /**
     * 主表字段
     */
    @NotNull
    @Size(min = 1, message = "主表字段不能为空")
    @Schema(description = "主表字段")
    private List<String> mainTableFields;

    /**
     * 外键关联表id
     */
    @NotNull
    @Min(value = 1)
    @Schema(description = "外键关联表id")
    private Long foreignTableId;

    /**
     * 关联表字段
     */
    @NotNull
    @Size(min = 1, message = "关联表字段不能为空")
    @Schema(description = "关联表字段")
    private List<String> foreignTableFields;

    @NotNull
    @Min(value = 0)
    @Schema(description = "关联关系  0-一对一 1-一对多 2-多对一")
    private Integer type;
}
